Skip to content

Bring all main changes into develop#77

Closed
TheWitness wants to merge 63 commits intodevelopfrom
main
Closed

Bring all main changes into develop#77
TheWitness wants to merge 63 commits intodevelopfrom
main

Conversation

@TheWitness
Copy link
Member

No description provided.

Linegod and others added 30 commits November 17, 2024 13:13
Currently translated at 83.0% (279 of 336 strings)

Translation: Cacti/servcheck
Translate-URL: http://translate.cacti.net/projects/cacti/servcheck/ru/
* QA: Unable to save the poller for a service check

* Add mqtt test (#23)

* add mqtt test

* formatting

* update

* add DOH

* update

* changes requested

* develop to main + small changes

---------

Co-authored-by: TheWitness <thewitness@cacti.net>
…formed and some don't #27 (#28)

* Update CHANGELOG.md

* poller_servcheck.php

* servcheck_test.php

* arrays.php
* Add mqtt test (#23)

* add mqtt test

* formatting

* update

* add DOH

* update

* changes requested

* fix plaintext DNS (incorrect variable)

* fix plaintext dns - remove cert settings

* fix DNS test when incorrect dns server is configured

* update
…ally from cacti poller (Issue #31) (#32)

* Update CHANGELOG.md

* poller_servcheck.php

* servcheck_test.php

* arrays.php

* issue #31

fix poller_servcheck.php does not run any test when it runs automatically from cacti poller

* issue #31

fix poller_servcheck.php does not run any test when it runs automatically from cacti poller

* typo line 326 arrays.php

* Update servcheck_test.php

order by the statistics

* Update CHANGELOG.md
* Fix graph is not displayed correctly issue#2

Fix graph is not displayed correctly issue#2

* Update CHANGELOG.md
* Update poller_servcheck.php

/* let PHP run just as long as it has to */
// modified by MSS on 2025-03-08
//ini_set('max_execution_time', '120');

* Update servcheck_process.php

Fix a bug in the certificate check

* Update servcheck_test.php

Enhancement on the graph page

* Update setup.php

Add 30 days to check the certificate validity

* Update functions.php

Finetune the graph display.

* Update tests.php

Fix bugs related to CA certificate
Fix typos

* Update CHANGELOG.md

Fix certificate check does not function as expected #35

* Update servcheck_process.php

Revise the date format.

* Update servcheck_process.php

Finetuning the date format

* Update CHANGELOG.md

Fix certificate check does not function as expected #36

* Update CHANGELOG.md

* issue#36: Fix certificate check does not function as expected

* Update functions.php

* issue#36: Fix certificate check does not function as expected

* Update tests.php

* issue#36: Fix certificate check does not function as expected

* Update servcheck_process.php

removing undesired commented lines.

* Update poller_servcheck.php

/* let PHP run just as long as it has to */
ini_set('max_execution_time', '270');

and removing sleep(2) after exec background

* Update CHANGELOG.md

issue#35: Fix certificate check does not function as expected

* Update servcheck_process.php

(isset($test['expiry_date']) ? $test['expiry_date'] : 'Invalid Expiry Date')
Currently translated at 100.0% (336 of 336 strings)

Translation: Cacti/servcheck
Translate-URL: http://translate.cacti.net/projects/cacti/servcheck/sv/
Currently translated at 100.0% (336 of 336 strings)

Translation: Cacti/servcheck
Translate-URL: http://translate.cacti.net/projects/cacti/servcheck/sv/
* Date format update from from 'd-b-Y h:i:s p' to 'd-M-Y h:i:s A'

Date format update from from 'd-b-Y h:i:s p' to 'd-M-Y h:i:s A'

* apply the date format as per Cacti using date_time_format()

apply the date format as per Cacti using date_time_format()
…['expiry_date'] (#38)

apply the date format as per Cacti using date_time_format() for $test['expiry_date']
… certificate. (#39)

* Create /cert/ca-bundle.crt

create /cert folder and move ca-bundle.crt to it.

* Delete ca-bundle.crt as it is moved to /servcheck/cert folder

Delete ca-bundle.crt as it is moved to /servcheck/cert folder

* Update tests.php enhance own certificate usage

Update tests.php enhance own certificate usage

* add dedicated folder for certificates and enhance the usage of custom certificate.

add dedicated folder for certificates and enhance the usage of custom certificate.
* Add mqtt test (#23)

* add mqtt test

* formatting

* update

* add DOH

* update

* changes requested

* beginning

* beginning2

* change creating sql tables

* add new restapi

* finishing rest api form

* add missing column

* clean validation, restapi test remains

* add missing authid_name save

* first test

* basic auth works

* preparing oauth2

* apikey working

* working cookie

* all is broken

* done

* add old code

* update
* better validation (remove old webseer code)

* update
When first running a test, it has no last results.
ERROR PHP WARNING in Plugin 'servcheck': Undefined array key "result_search" in file: plugins/servcheck/poller_servcheck.php on line: 191
ERROR PHP WARNING in Plugin 'servcheck': Undefined array key "result" in file: plugins/servcheck/poller_servcheck.php on line: 185
strpo === 0 means it would only run if the : was at the beginning of the line.  Should use !== FALSE or the new str_contains function.

$service_types_ports wasn't set as a global, so it was empty inside the function (noticed after fixing above).
Webseer used to have this back in the day, super handy.
* fix #42 - duplicate tests

* update
Currently translated at 21.1% (71 of 336 strings)

Translation: Cacti/servcheck
Translate-URL: https://translate.cacti.net/projects/cacti/servcheck/ka/
Currently translated at 30.0% (101 of 336 strings)

Translation: Cacti/servcheck
Translate-URL: https://translate.cacti.net/projects/cacti/servcheck/ka/
Currently translated at 35.1% (118 of 336 strings)

Translation: Cacti/servcheck
Translate-URL: https://translate.cacti.net/projects/cacti/servcheck/ka/
Currently translated at 35.7% (120 of 336 strings)

Translation: Cacti/servcheck
Translate-URL: https://translate.cacti.net/projects/cacti/servcheck/ka/
Currently translated at 43.1% (145 of 336 strings)

Translation: Cacti/servcheck
Translate-URL: https://translate.cacti.net/projects/cacti/servcheck/ka/
Currently translated at 46.1% (155 of 336 strings)

Translation: Cacti/servcheck
Translate-URL: https://translate.cacti.net/projects/cacti/servcheck/ka/
Currently translated at 54.4% (183 of 336 strings)

Translation: Cacti/servcheck
Translate-URL: https://translate.cacti.net/projects/cacti/servcheck/ka/
Daniel Nylander and others added 24 commits October 17, 2025 12:18
Currently translated at 100.0% (336 of 336 strings)

Translation: Cacti/servcheck
Translate-URL: https://translate.cacti.net/projects/cacti/servcheck/sv/
Currently translated at 100.0% (336 of 336 strings)

Translation: Cacti/servcheck
Translate-URL: https://translate.cacti.net/projects/cacti/servcheck/sv/
Currently translated at 100.0% (336 of 336 strings)

Translation: Cacti/servcheck
Translate-URL: https://translate.cacti.net/projects/cacti/servcheck/sv/
Currently translated at 100.0% (336 of 336 strings)

Translation: Cacti/servcheck
Translate-URL: https://translate.cacti.net/projects/cacti/servcheck/sv/
* fix incorrect parameter count, rename functions

* fix issue if from_email is not set

* include vs require
Currently translated at 100.0% (336 of 336 strings)

Translation: Cacti/servcheck
Translate-URL: https://translate.cacti.net/projects/cacti/servcheck/sv/
Currently translated at 100.0% (336 of 336 strings)

Translation: Cacti/servcheck
Translate-URL: https://translate.cacti.net/projects/cacti/servcheck/sv/
Added checks for the existence of the 'plugin_servcheck_restapi_method' table before creating backups and processing records. Refactored credential handling for different types and ensured proper encryption and database updates.
* Change duration color code in arrays.php

* Update certificate expiry notification settings

---------

Co-authored-by: TheWitness <thewitness@cacti.net>
* Change duration color code in arrays.php

* Update certificate expiry notification settings

---------

Co-authored-by: TheWitness <thewitness@cacti.net>
* Refactor certificate expiry handling and notifications

Updated certificate expiry date handling and notification logic.

The previous certificate expiry date logic retrieves the expiry date as UTC not local.

Enhanced the code so that to eliminate unnecessary overwhelming email notifications, for every change in the certificate. It is recommended to be disabled so that to focust on the expiring and expired certificates.

Enhanced the code so that to eliminate unnecessary overwhelming email notifications, for every change search string. It is recommended to be disabled so that to focus on the notifications that require action.

* Add styles for selected table rows in servcheck_test

Added styles for selected table rows to change background and font color.

	// When a row is selected, set the backgound-color as black and font color as white
	print "<style>
				tr.tableRow.selectable.selected, tr.tableRow.selectable.selected td {
					background-color: #000 !important;
					color: #fff !important;
				}
			</style>";

* Change 'ok' color code in arrays.php

* Enhance row selection and hover styles in servcheck_test

* Fix typo in comment for row styling

* Refactor email sending logic in servcheck_process.php

* Update servcheck_test.php

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update servcheck_process.php

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update servcheck_test.php

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Refactor CSS for selectable rows to use function

Replaced inline CSS for selectable rows with a function call.

* Fix typo in comment for email notifications

* Update servcheck_process.php

* Update servcheck_process.php

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Include local timezone in certificate expiration messages

Added local timezone information to certificate expiration notifications.

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Add agents and Pipelines
Add missing .github folder
Currently translated at 58.8% (197 of 335 strings)

Translation: Cacti/servcheck
Translate-URL: https://translate.cacti.net/projects/cacti/servcheck/zh_Hant/
* Add Signal Handling, Cacti process registration, and php-cs-fixer

* Make sure the record is removed

* Fixing some warnings

* Remove table from replication as it's been removed

* Changes per Copilot review

* More Copilot recommendations
* Small issue with no tests

* Syntax error in SQL

* Update poller_servcheck.php

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update workflow

* Update workflow

* Updating workflows

* Add the development component

* Script Permissions

* Script Permissions

* Fix php-cs-fixer issues
* new stats, log retention, cpu/mem stats

* remove old code

* csfixer

---------

Co-authored-by: TheWitness <thewitness@cacti.net>
* Add Agents/Pipeline

Add agents and Pipelines
Add missing .github folder

* Create copilot-instructions.md

* Update plugin-ci-workflow.yml

* Update .github/copilot-instructions.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update copilot-instructions.md

* Remove duplicate agent files

* Initial plan

* Rename triage_agent.md.agent.md to triage_agent.agent.md

Co-authored-by: bmfmancini <13388748+bmfmancini@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: bmfmancini <13388748+bmfmancini@users.noreply.github.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request merges changes from the main branch into develop, representing a significant version update from 0.2 to 0.4 for the Cacti servcheck plugin. The PR includes copyright year updates (2024→2025), architectural refactoring with new test implementation modules, credential encryption enhancements, and process management improvements.

Changes:

  • Version bump from 0.2 to 0.4 with extensive feature additions per CHANGELOG
  • Refactored test implementations into modular files (test_*.php)
  • Added new credential encryption system using AES-256-CBC
  • Renamed/consolidated proxy management (servcheck_proxies.php → servcheck_proxy.php)
  • Added GitHub workflow for CI/CD and agent configuration files
  • Updated copyright years across all files to 2025

Reviewed changes

Copilot reviewed 43 out of 44 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
INFO Version updated from 0.2 to 0.4
CHANGELOG.md Documents new features in 0.3 and 0.4 releases
servcheck_restapi.php New REST API management page (marked as read-only, deprecated for v0.5)
servcheck_proxy.php Replaces servcheck_proxies.php with updated structure
servcheck_proxies.php Deleted (replaced by servcheck_proxy.php)
servcheck_ca.php Major refactoring with consistent patterns
poller_servcheck.php Enhanced process control and signal handling
includes/test_*.php New modular test implementations (SSH, SNMP, REST API, MQTT, Mail, FTP, DNS, cURL)
includes/tests.php Deleted (replaced by modular test files)
includes/functions.php Added encryption/decryption functions, renamed plugin_servcheck_* to servcheck_*
includes/mxlookup.php Code formatting improvements
tmp_data/index.php New security redirect file
locales/po/*.po Translation updates
README.md Updated documentation with new features
.github/ Added CI/CD workflow and agent configurations


html_end_box();

print '<b><font color="red">Rest API was moved to tests. Authhorization data was moved to Credential tab. This is read-only and will be removed in version 0.5</font></b>';
Copy link

Copilot AI Feb 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in the warning message: "Authhorization" should be "Authorization".

Copilot uses AI. Check for mistakes.

$columns = cacti_sizeof($display_text);

print '<b><font color="red">Rest API was moved to tests. Authhorization data was moved to Credential tab. This is read-only and will be removed in version 0.5</font></b>';
Copy link

Copilot AI Feb 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in the warning message: "Authhorization" should be "Authorization".

Copilot uses AI. Check for mistakes.

form_end();

print '<b><font color="red">Rest API was moved to tests. Authhorization data was moved to Credential tab. This is read-only and will be removed in version 0.5</font></b>';
Copy link

Copilot AI Feb 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in the warning message: "Authhorization" should be "Authorization" (same spelling error appears three times in this file).

Copilot uses AI. Check for mistakes.
// curl needs username with %40 instead of @
$cred = str_replace('@', '%40', $credential['username']);
$cred .= ':';
$cred .= $credial['password'];
Copy link

Copilot AI Feb 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in variable name: "$credial" should be "$credential".

Suggested change
$cred .= $credial['password'];
$cred .= $credential['password'];

Copilot uses AI. Check for mistakes.
Comment on lines +172 to +173
if (isset($key_filename)) {
unlink($key_filename);
Copy link

Copilot AI Feb 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Undefined variable: "$key_filename" is used but only "$keyfilename" is defined. This should be "$keyfilename" to match the variable defined on line 109.

Suggested change
if (isset($key_filename)) {
unlink($key_filename);
if (isset($keyfilename)) {
unlink($keyfilename);

Copilot uses AI. Check for mistakes.
@TheWitness TheWitness closed this Feb 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants